<template>
  <div>

    <!--    表格-->
    <el-table :data="transportLineTypeData.items">
      <el-table-column label="线路类型编号 " prop="typeNumber"/>
      <el-table-column label="线路类型名称" prop="name"/>
      <el-table-column label="起始机构类型">
        <p>网点</p>
      </el-table-column>
      <el-table-column label="终点机构类型">
        <p>网点</p>
      </el-table-column>
      <el-table-column label="最近修改时间" prop="lastUpdateTime"/>
      <el-table-column label="状态" prop="status">
        <template slot-scope="scope">
          <p v-if="scope.row.status==0">禁用</p>
          <p v-if="scope.row.status==1">正常</p>
        </template>
      </el-table-column>
    </el-table>
    <!--    分页-->
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="Number(transportLineTypeData.page)"
      :page-sizes="[5, 10, 30, 50]"
      :page-size="Number(transportLineTypeData.pageSize)"
      layout="total, sizes, prev, pager, next, jumper"
      :total="Number(transportLineTypeData.counts)"
    >
    </el-pagination>
  </div>
</template>

<script>
import transportLineType from '@/api/base/transportLineType/index'

export default {
  name: 'index',
  data() {
    return {
      transportLineTypeData: {},
      pageNum: 1,
      pageSize: 5
    }
  }, methods: {
    handleSizeChange(val) {
      this.pageSize = val
      this.getTransportLinePage()
    },
    handleCurrentChange(val) {
      this.pageNum = val
      this.getTransportLinePage()
    },
    getTransportLinePage() {
      transportLineType.getTransportLinePage(this.pageNum, this.pageSize).then(data => {
        this.transportLineTypeData = data.data
      })
    }
  }, mounted() {
    this.getTransportLinePage()
  }
}
</script>

<style scoped>

</style>
